<template>
  <div class="information">
    <van-tabs sticky swipeable @change="changeTab">
      <van-tab v-for="(item, index) in tabList" :key="index" :title="item.n">
        <scroll-view :id="item.i"></scroll-view>
      </van-tab>
    </van-tabs>
    <div style="height: 70px;"></div>
    <tabbar></tabbar>
  </div>
</template>
<script>
import md5 from 'js-md5'
import axios from 'axios'
import ScrollView from '@/components/ScrollView'
import Tabbar from '@/components/Tabbar'
export default {
  components: {
    ScrollView,
    Tabbar
  },
  data () {
    return {
      tabList: []
    }
  },
  created () {
    this.getInfoTab()
    _czc.push(['_trackEvent', 'hot_click'])
  },
  methods: {
    getInfoTab () {
      const aid = 'ae8e951cfdffe948'
      const pid = 'c745df837e85b7d64ccd20fd822da75e'
      const u = ''
      const v = '1.0.0'
      const m = 'wx'
      const d = ''
      const t = Date.now()
      const s = md5(u + '&' + v + '&' + m + '&' + d + '&' + t + '&' + aid)
      axios({
        url: 'https://nav.gionee.com/feed/channel.do',
        method: 'GET',
        params: {
          aid,
          pid,
          u,
          v,
          m,
          d,
          t,
          s
        }
      }).then(res => {
        this.tabList = res.data.data
      })
    },
    changeTab (index) {
      _czc.push(['_trackEvent', 'hot_channel_exposure'], index)
    }
  }
}
</script>
